<template>
    <van-cell
        class="article-item"
        :to="{name: article, params:{articleId:article.art_id}}"
    >
        <div slot="title" class="title van-muti-ellipsis--13">{{ article.title}}</div>
        <div slot="label">
            <div 
                v-if="article.cover.type===3"
                class="cover-wrap"
            >
                <div class="cover-wrap-item"
                    v-for="(img, index) in article.cover.images"
                    :key="index"
                >
                    <van-image
                        class="cover-image"
                        fit="cover"
                        :src="img"
                    />
                </div>
            </div>
            <div class="label-wrap">
                <span>{{article.aut_name}}</span>
                <span>{{article.comm_count}}评论</span>
                <span>{{article.pubdate | relativeTime}}</span>
            </div>
        </div>

        <van-image 
            v-if="article. cover.type ===1 "
            class="right-cover"
            fit="cover"
            :src="article.cover.images[0]"
        />
    </van-cell>
</template>

<script>
export default {
    props:{
        article:{
            type:Object,
            required: true
        }
    },
    data () {
        return {}
    }
}
</script>